async function getGH(user, repo, path) {
    let files = await getDeep(user, repo, path);
    return { files };
}
async function getDeep(user, repo, path) {
    let all = await fetch(`https://api.github.com/repos/${user}/${repo}/contents/${path}`, { headers: { Authorization: "token d153830ebe76c9337ed4af20f51c17795ba4c101" } }).then((res) => res.json());

    for (let i = 0; i < all.length; i++) {
        all[i].type === "dir" && ((all[i].type = "directory"), (all[i].files = await getDeep(user, repo, all[i].path)));
    }

    return all;
}
export default getGH;
